package org.scala.javafx.apps

import javafx.stage.Stage
import javafx.scene.Group
import javafx.event.EventHandler
import javafx.scene.input.MouseEvent
import javafx.scene.Node
import javafx.scene.control.Label
import javafx.application.Application
import javafx.scene.Scene
import org.scala.javafx.control.TabPane
import org.scala.javafx.control.Tab
import org.scala.javafx.diagnostics.Spy
import org.scala.javafx.rich.Enrich._
import javafx.scene.layout.StackPane
import javafx.scene.layout.HBox
import javafx.scene.layout.Priority

class TabPaneTest extends Application {
  override def start(stage: Stage): Unit = {
    stage.setTitle("The JavaFX Bank")
    // Create the node structure for display
    val rootNode = new Group()
    val scene = new Scene(rootNode, 200, 200)
    Spy.explore(scene)
    val tabPane = new TabPane()
    rootNode.getChildren().addAll(tabPane)
    val tab1 = new Tab("Title 1")
    val stackPane1 = new StackPane()
    tab1.content = stackPane1
    stackPane1.getChildren.add(new Label("Content 1"))
    stackPane1.setStyle("-fx-background-color: blue");
    val tab2 = new Tab("Title 2")
    tab2.content = new Label("Content 2")
    val tab3 = new Tab("Title 3")
    tab3.content = new Label("Content 3")
    tabPane.tabs.addAll(tab1, tab2, tab3)
    scene.getStylesheets().addAll("org/scala/javafx/resources/basics.css")
    stage.setScene(scene)
    stage.show()
  }
}

object TabPaneTest {
  def main(args: Array[String]): Unit = {
    Application.launch(classOf[TabPaneTest], args)
  }
}
